package com.solace.disruptor.solace;

import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger;

public class AtomicSum {
    public void priStr(){
        synchronized (this){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("priStr:"+Thread.currentThread().getName()+":"+System.currentTimeMillis());
        }
    }
    public void priStr1(){
        synchronized (new Date()){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("priStr1:"+Thread.currentThread().getName()+":"+System.currentTimeMillis());
        }
    }
    public void priStr2(){
        synchronized (new Date()){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("priStr2:"+Thread.currentThread().getName()+":"+System.currentTimeMillis());
        }
    }

}
